---@class Table_GlobalDialogItem
local Table_GlobalDialogItem = BaseClass("Table_GlobalDialogItem", IDataItem)

function Table_GlobalDialogItem:__ctor()
	---@type number @唯一ID
	self.Id = 0
	---@type number @对话框类型
	self.TipType = 0
	---@type number @对话标题ID
	self.Title = 0
	---@type number @内容ID
	self.ContentId = 0
	---@type number[] @按钮文本ID
	self.BtnName = {}
	---@type boolean @是否显示关闭
	self.TapClose = false
end

function Table_GlobalDialogItem:Load(reader)
	self.temp = reader:ReadShortString()
	self.Id = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.TipType = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.Title = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.ContentId = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.BtnName = Utility.StringToNumbers(self.temp)
	self.TapClose = reader:ReadBool()
end

---@class Table_GlobalDialogMgr : IDataMgr
local this = BaseClass("Table_GlobalDialogMgr", IDataMgr)

function this:FileName()
	return "Txt/GlobalDialog.txt"
end

---@return Table_GlobalDialogItem
function this:GetItemByKey(key)
	return self.super.GetItemByKey(self, key)
end

---@return Table_GlobalDialogItem
function this:GetItemByIdx(idx)
	return self.super.GetItemByIdx(self, idx)
end

function this:Load(reader)
	local item = Table_GlobalDialogItem()
	item:Load(reader)
	self.mItemDic[item.Id] = self.mDataCount
	table.insert(self.mItemList, item)
end

---@type Table_GlobalDialogMgr
Table_GlobalDialogMgr = this()